home *** CD-ROM | disk | FTP | other *** search
/ Tricks of the Windows Game Programming Gurus / Tricks of the Windows Game Programming Gurus (SAMS)(2000).iso / Goodies / t3dlib2.h < prev    next >
Encoding:
C/C++ Source or Header  |  1999-02-26  |  1.8 KB  |  58 lines

  1. // T3DLIB2.H - Header file for T3DLIB2.CPP game engine library
  2.  
  3. // watch for multiple inclusions
  4. #ifndef T3DLIB2
  5. #define T3DLIB2
  6.  
  7. // DEFINES ////////////////////////////////////////////////
  8.  
  9. // MACROS /////////////////////////////////////////////////
  10.  
  11.  
  12.  
  13. // TYPES //////////////////////////////////////////////////
  14.  
  15.  
  16.  
  17. // PROTOTYPES /////////////////////////////////////////////
  18.  
  19.  
  20. // input
  21. int DInput_Init(void);
  22. void DInput_Shutdown(void);
  23. int DInput_Init_Joystick(int min_x=-256, int max_x=256, int min_y=-256, int max_y=256, int dead_band = 10);
  24. int DInput_Init_Mouse(void);
  25. int DInput_Init_Keyboard(void);
  26. int DInput_Read_Joystick(void);
  27. int DInput_Read_Mouse(void);
  28. int DInput_Read_Keyboard(void);
  29. void DInput_Release_Joystick(void);
  30. void DInput_Release_Mouse(void);
  31. void DInput_Release_Keyboard(void);
  32.  
  33.  
  34. // GLOBALS ////////////////////////////////////////////////
  35.  
  36.  
  37. // EXTERNALS //////////////////////////////////////////////
  38.  
  39. extern HWND main_window_handle; // save the window handle
  40. extern HINSTANCE main_instance; // save the instance
  41.  
  42. // directinput globals
  43. extern LPDIRECTINPUT        lpdi;       // dinput object
  44. extern LPDIRECTINPUTDEVICE  lpdikey;    // dinput keyboard
  45. extern LPDIRECTINPUTDEVICE  lpdimouse;  // dinput mouse
  46. extern LPDIRECTINPUTDEVICE2 lpdijoy;    // dinput joystick 
  47. extern GUID                 joystickGUID; // guid for main joystick
  48. extern char                 joyname[80];  // name of joystick
  49.  
  50. // these contain the target records for all di input packets
  51. extern UCHAR keyboard_state[256]; // contains keyboard state table
  52. extern DIMOUSESTATE mouse_state;  // contains state of mouse
  53. extern DIJOYSTATE joy_state;      // contains state of joystick
  54. extern int joystick_found;        // tracks if stick is plugged in
  55. #endif
  56.  
  57.  
  58.